package com.ykq.system.controller.api;

import com.ykq.pojo.entity.User;
import com.ykq.system.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: education-parent
 * @description:
 * @author: 闫克起2
 * @create: 2022-08-03 11:08
 **/
@RestController
@RequestMapping("/api/system/user")
public class ApiUserController {

    @Autowired
    private UserService userService;

    //如果接口提供给其他微服务用，那么直接返回实体类对象即可。如果接口给前端使用CommonResult
    @GetMapping("findByName/{username}")
    public User findByName(@PathVariable String username){
       User user = userService.selectByName(username);
       return user;
    }
}























